/*
 * All rights Reserved, Copyright (C) wifi LIMITED 2019
 * FileName: ManageLogBean.java
 * Version:  $Revision$
 * Modify record:
 * NO. |     Date       |    Name         |      Content
 * 1   | 2019年11月15日        | wangjian    | original version
 */
package com.pl.service.impl;  

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pl.bean.ManageLogBean;
import com.pl.dao.ManageLogBeanDao;
import com.pl.service.ManageLogService;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import javax.annotation.Resource;

/**
 * class name:ManageLogServiceImpl <BR>
 * class description:  <BR>
 * Remark: <BR>
 * @version 1.00 2019年11月15日
 * @author wangjian
 */
@Service("manageLogService")
public class ManageLogServiceImpl extends ServiceImpl<ManageLogBeanDao, ManageLogBean> implements ManageLogService{

	private static Logger log = LogManager.getLogger();

	@Resource(name="manageLogBeanDao")
	private ManageLogBeanDao manageLogBeanDao;

	/**
	 * Method name: addManageLog <BR>
	 * Description: 新增 <BR>
	 * Remark: <BR>
	 * @param manageLogBean  void<BR>
	 * @date 2019年11月15日
	 * @author wangjian
	 */
	@Transactional
	public void addManageLog(ManageLogBean manageLogBean){
		
		manageLogBeanDao.addManageLogBean(manageLogBean);
	}

	/**
	 * Method name: updateManageLog <BR>
	 * Description: 修改 <BR>
	 * Remark: <BR>
	 * @param manageLogBean  void<BR>
	 * @date 2019年11月15日
	 * @author wangjian
	 */
	@Transactional
	public void updateManageLog(ManageLogBean manageLogBean){
		
		manageLogBeanDao.updateManageLogBean(manageLogBean);
	}
	
	/**
	 * Method name: getManageLogNum <BR>
	 * Description: 根据条件获得数量 <BR>
	 * Remark: <BR>
	 * @param manageLogBean
	 * @return  int<BR>
	 * @date 2019年11月15日
	 * @author wangjian
	 */
	public int getManageLogNum(ManageLogBean manageLogBean){
		
		return manageLogBeanDao.getManageLogBeanNum(manageLogBean);
	}
	
	/**
	 * Method name: getManageLog <BR>
	 * Description: 根据条件获得数据 <BR>
	 * Remark: <BR>
	 * @param manageLogBean
	 * @return  List<ManageLogBean><BR>
	 * @date 2019年11月15日
	 * @author wangjian
	 */
	public List<ManageLogBean> getManageLog(ManageLogBean manageLogBean){
		
		return manageLogBeanDao.getManageLogBean(manageLogBean);
	}
	
	/**
	 * Method name: getManageLogById <BR>
	 * Description: 根据条件获得数据 <BR>
	 * Remark: <BR>
	 * @param id
	 * @return  ManageLogBean<BR>
	 * @date 2019年11月15日
	 * @author wangjian
	 */
	public ManageLogBean getManageLogById(Long id){
		
		ManageLogBean manageLogBean = new ManageLogBean();
		manageLogBean.setId(id);
		
		List<ManageLogBean> list = getManageLog(manageLogBean);
		if(list !=null && !list.isEmpty()){
    		return list.get(0);
    	}
    	
    	return null;
	}
}
